function plugin_img(str) {
  var label, link;
  var i = str.indexOf('|', 0);
  if(-1 == i) {
    label = str;
    link = str;
  }
  else {
    label = str.substring(0, i);
    link = str.substring(i + 1);
  }
  if(isUri(link)) {
    return '<img alt="' + label + '" src="' + link + '" />';
  }
  else {
    return '<img alt="' + label + '" src="' + MEDIA_URL + 'plugins/img/' + link + '" />';
  }
}

plugins['img'] = plugin_img;
